package com.smart.seckilldemo.service;

import com.smart.seckilldemo.commons.result.ResponseResult;
import com.smart.seckilldemo.pojo.User;
import com.smart.seckilldemo.commons.vo.LoginVo;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public interface UserService {

    /**
     * 登陆
     * @param loginVo
     * @param request
     * @param response
     * @return
     */
    ResponseResult login(LoginVo loginVo, HttpServletRequest request, HttpServletResponse response);

    /**
     * 根据 cookie 的key 去从 redis 中获取用户
     * @param userTicket
     * @param request
     * @param response
     * @return
     */
    User getUserByCookie(String userTicket, HttpServletRequest request, HttpServletResponse response);

    /**
     * 注册
     * @param loginVo
     * @return
     */
    ResponseResult registerUser(LoginVo loginVo);

    /**
     * 获取用户信息
     * @param name 名字
     * @return
     */
    User getUserByName(String name);

    User getUserById(Long userId);

    /**
     * 修改密码
     * @param userTicket
     * @param password
     * @return
     */
    ResponseResult updatePassword(String userTicket,String password,HttpServletRequest request, HttpServletResponse response);


}
